package controller;

import javafx.application.Platform;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Label;
import javafx.scene.input.MouseEvent;
import thread.UpdateThread;

import java.net.URL;
import java.util.ResourceBundle;

public class UpdateController implements Initializable {
    @FXML
    Label label;
    public static UpdateController controller;
    @Override
    public void initialize(URL url, ResourceBundle resourceBundle) {
        controller = this;
        update();
    }


    public void exist(MouseEvent mouseEvent) {
        Platform.exit();
    }

    public void setLabelText(String text){
        label.setText(text);
    }

    private void update(){
        Thread updateThread = new Thread(new UpdateThread());
        updateThread.start();
    }
}
